package 力扣日常刷题.木22一月.第02天0109;

/**
 * @author 帅小伙
 * @date 2022/1/9
 * @description https://leetcode-cn.com/problems/final-value-of-variable-after-performing-operations/
 */
public class Demo06数组中等执行操作后变量值 {


    public int finalValueAfterOperations(String[] operations) {
        int res = 0;

        for (String operation : operations) {
            if(operation.charAt(1)=='+'){
                res++;
            }else{
                res--;
            }
        }
        return res;
    }


}
